﻿@model List<CustomerServiceCenter.Models.TicketWeiXinModel>
@{
    Layout = null;
 }

    <!DOCTYPE HTML>

    <html>
    <head>
        <meta charset="UTF-8" name="viewport" content="width=device-width" />
        <title>客户服务</title>
        <link href="~/Content/font-awesome.min.css" rel="stylesheet" />
        <link href="~/content/bootstrap.min.css" rel="stylesheet" />
        <link href="~/content/wechat/basic.css" rel="stylesheet" />
        <link href="~/content/wechat/HomePage.css" rel="stylesheet" />

    </head>
    <body>
        <header class="style-bg-blue">
            <div id="going" class="h col-xs-6">
                <p>正在进行</p>
            </div>
            <div id="history" class="h col-xs-6">
                <p>历史记录</p>
            </div>

        </header>

        <div class="container">

            <div class="tag style-bg-green"></div>
            @if (@ViewData["Client"] != null)
            {
                <img src="~/content/wechat/logo/@ViewData["Client"]" class="logo" />
                
            }
            @if (@Model != null)
{
    foreach (CustomerServiceCenter.Models.TicketWeiXinModel ticket in @Model)
    {
        <div class="ticket">
            
            <input class="ticketID" type="hidden" value="@ticket.TicketID" />
            <input class="issueDesciption" type="hidden" value="@ticket.IssueDescription" />
            <input class="orderNumber" type="hidden" value="@ticket.OrderNumber" />
            <div class="clearfix">
                <p class="col-xs-8">@ticket.IssueType <i class="fa fa-angle-right"></i></p>
                
                <p class="col-xs-4 status">@ticket.Status</p>
            </div>
            <div class="clearfix">
                <label for="" class="col-xs-4">创建时间：</label>
                <p class="s-time col-xs-8 submitDate">@string.Format("{0:yyyy年MM月dd日}", ticket.SubmitDate)</p>
            </div>
            <div class="clearfix">
                <label for="" class="col-xs-4">受理时间：</label>
                <p class="e-time col-xs-8">@string.Format("{0:yyyy年MM月dd日}", ticket.AssignDate)</p>
            </div>
            <div class="clearfix">
                <label for="" class="col-xs-4">技术专员：</label>
                <p class="col-xs-4 assignerName">@ticket.AssignerName</p>
                @*<a href="wtai://wp//mc;18040511056"> 联系专员</a>*@
                @if (ticket.Mobile != null)
                {
                    <i class="fa fa-phone col-xs-4 style-green mobile"><a onclick="event.stopPropagation();" href="tel:@ticket.Mobile">拨打专线</a></i>
                }
                else
                {
                    <i class="fa fa-phone col-xs-4 style-green mobile"><a onclick="event.stopPropagation();" href="tel:@ticket.OnCall">拨打专线</a></i>
                }

                <hr class="col-xs-10 style-bg-green" />
            </div>
        </div>
    }
}
            </div>
            <footer class="col-xs-12">
                <button class="col-xs-12 style-bg-blue" id="create">创建请求</button>
            </footer>

            <script src="~/scripts/jquery-1.8.2.min.js"></script>
            <script type="text/javascript">
                $(function () {
                    homePage.init();

                    $(".ticket").click(function () {
                        var ticketID = $(this).find(".ticketID").val();
                        location.href = "../WeChat/TicketOperationInfo?ticketID=" + ticketID;
                        event.stopPropagation();        //阻止冒泡
                    });

                    $("#create").click(function() {
                        location.href = "../WeChat/WriteFeedback";
                    });
                });

                var homePage = {
                    init: function () {

                        homePage.showStyly();

                    },

                    showStyly: function () {
                        var flag = location.href.split("=");
                        var $inTag = $(".h");
                        var headline = '<div class="headline style-bg-green"></div>';
                        if (flag[1] == "history") {
                            $("#history").append(headline);
                        } else {
                            $("#going").append(headline);
                        }

                        $inTag.click(function() {
                            var $clickID = $(this).attr("id");
                            if ($clickID == "history") {
                                location.href = "../WeChat/HomePage?type=history";
                            } else {
                                location.href = "../WeChat/HomePage";

                            }
                        });
                    }
                }


            </script>
        </body>
    </html>
